package com.mezz.bones.im.logic.service.im;

import cn.hutool.core.util.StrUtil;
import com.mezz.bones.im.logic.service.IChatAutoReplayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ChatAutoReplayServiceImpl implements IChatAutoReplayService {

    /**
     * 获取供应商自动回复内容
     * @param supplierId
     * @param content
     * @return
     */
    @Override
    public String getSrmAutoReplayContent(String supplierId, String content) {

        if(StrUtil.isBlank(content)){
            return "";
        }

        //TODO 获取匹配的自动回复规则数据
        String res = "";
        String ruleId = "";

        log.info("供应商={}, 触发自动回复规则={}, 原消息={}, 自动回复消息={}", supplierId, ruleId, content , res);

        return "自动回复消息[Srm]";
    }

    /**
     * 获取SaaS自动回复内容
     * @param content
     * @return
     */
    @Override
    public String getSaasAutoReplayContent(String content) {

        if(StrUtil.isBlank(content)){
            return "";
        }

        String res = "";
        String ruleId = "";

        log.info("SaaS触发自动回复规则={}, 原消息={}, 自动回复消息={}", ruleId, content , res);

        return "自动回复消息[SaaS]";
    }
}
